
import request from '@/utils/request'


/**新增租户角色-供应商*/
export function insertD(data) {
  return request({
    url: '/distribution/roleDistr/insertD',
    method: 'post',
    data
  })
}

/**修改租户角色-供应商*/
export function editD(data) {
  return request({
    url: '/distribution/roleDistr/editD',
    method: 'post',
    data
  })
}

/**删除租户角色信息-供应商*/
export function deleteD(data) {
  return request({
    url: '/distribution/roleDistr/deleteD',
    method: 'POST',
    data
  })
}



/**新增租户角色-卖家*/
export function insertS(data) {
  return request({
    url: '/distribution/roleDistr/insertS',
    method: 'post',
    data
  })
}

/**修改租户角色-卖家*/
export function editS(data) {
  return request({
    url: '/distribution/roleDistr/editS',
    method: 'post',
    data
  })
}

/**删除租户角色信息-卖家*/
export function deleteS(data) {
  return request({
    url: '/distribution/roleDistr/deleteS',
    method: 'post',
    data
  })
}



/**
 * 获取推荐上级
 * 返回字段distrId为null说明没有上级
 * */
export function getReferrerRegisterDistributor(params) {
  return request({
    url: '/distribution/user/getReferrerRegisterDistributor',
    params
  })
}

/**修改供应商云池自动审批开关*/
export function updateDistributorAutoVerifyById(data) {
  return request({
    url: '/distribution/user/updateDistributorAutoVerifyById',
    method: 'post',
    data
  })
}


/**查询所有供应商列表*/
export function getDistributorList(params) {
  return request({
    url: '/distribution/distributorApply/getDistributorList',
    params
  })
}



/**查询供应商列表*/
export function getDistributorUserList(params) {
  return request({
    url: '/distribution/user/getDistributorUserList',
    params
  })
}


/**新增供应商 */
export function insertDistributorUser(data) {
  return request({
    url: `/distribution/user/insertDistributorUser`,
    method: 'POST',
    data
  })
}

/**描述：查询供应商用户列表*/
export function getDistributorUserListByDistrId(id) {
  return request({
    url: `/distribution/user/getDistributorUserListByDistrId?id=${id}`,
  })
}

/**新增供应商用户*/
export function insertDisUserByDistrId(data) {
  return request({
    url: `/distribution/user/insertDisUserByDistrId`,
    method: 'POST',
    data
  })
}

/**修改供应商用户*/
export function updateUserByDis(data) {
  return request({
    url: `/distribution/user/updateUserByDis`,
    method: 'POST',
    data
  })
}


/**修改用户状态*/
export function updateUserStatus(data) {
  return request({
    url: `/distribution/user/updateUserStatus`,
    method: 'POST',
    data
  })
}


/**描述：查询供应商信息*/
export function selectDistributorInfo(id) {
  return request({
    url: `/distribution/user/selectDistributorInfo?id=${id}`,
  })
}

/**修改供应商信息*/
export function updateDistributorUser(data) {
  return request({
    url: `/distribution/user/updateDistributorUser`,
    method: 'POST',
    data
  })
}



/**校验是否有操作权限 0-超级管理员 1-平台 2-卖家 3-供应商*/
export function checkOps(page) {
  return request({
    url: `/distribution/user/checkOps?page=${page}`,
  })
}


/**查询卖家，供应商推荐列表*/
export function getReferrerList(params) {
  return request({
    url: `/distribution/user/getReferrerList`,
    params
  })
}
